package com.peter.aop.aopdemo.service.impl;

import com.peter.aop.aopdemo.aop.OperLogAspect;
import com.peter.aop.aopdemo.dao.OpLog;
import com.peter.aop.aopdemo.dao.OpLogDao;
import com.peter.aop.aopdemo.logOperation.OperationLog;
import com.peter.aop.aopdemo.service.OperLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * ClassName: OperLogServiceImpl
 * author: bob.ly
 * Version: 1.0.0
 * DateTime: 2021/08/18-22:19:00
 * Description:
 */
@Service
@Slf4j
public class OperLogServiceImpl implements OperLogService {
    @Resource
    private OpLogDao opLogDao;

    @Override
    public void insertLog(OpLog oplog) {
        log.info("当前日志对象:{}", oplog);
        opLogDao.insert(oplog);
    }

    @Override
    @OperationLog(operModul = "提现模块", operDesc = "test一下")
    public void update(Long draw) {
        System.out.println(draw);
        OperLogAspect.updateTest(11111, 2222222);
    }
}
